package com.pmes.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ServerStartupListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent arg0) {

	}

	public void contextInitialized(ServletContextEvent evt) {
		
		// 获取web应用对象
		ServletContext application = evt.getServletContext();
		
		// 获取web应用路径
		String path = application.getContextPath();
		
		// 将路径存储在web应用范围内
		application.setAttribute("APP_PATH", path);
	}

}
